<template>
  <el-table
    :data="tableData"
    header-align="center"
    class="customer-table"
    height="table"
    empty-text="暂无数据"
  >
    <el-table-column prop="name" label="补助项" align="center">
    </el-table-column>
    <el-table-column prop="standards" label="补助标准" align="center">
    </el-table-column>
    <el-table-column prop="amount" label="补助金额" align="center">
    </el-table-column>
    <el-table-column prop="items" label="补助物品" align="center">
    </el-table-column>
    <el-table-column label="申请时间" align="center">
      <template slot-scope="scope">
        <div>
          {{ timezhuanhuan1(scope.row.applicationTime) }}
        </div>
      </template>
    </el-table-column>
    <el-table-column label="领取时间" align="center">
      <template slot-scope="scope">
        <div>
          {{ timezhuanhuan1(scope.row.pickUpTime) }}
        </div>
      </template>
    </el-table-column>
    <el-table-column
      prop="implementationPolicy"
      label="实施政策"
      align="center"
    >
    </el-table-column>
    <el-table-column prop="nationalPolicy" label="相关国家政策" align="center">
    </el-table-column>
  </el-table>
</template>

<script>
var { timezhuanhuan1 } = require("../../js/global");
export default {
  props: ["biaogeqingqiucanshu", "fenyexinxi"],
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    gengxin() {
      //更新表格
      this.huoqushuju();
    },
    huoqushuju() {
      let params = new URLSearchParams();
      params.append("page", this.fenyexinxi.currentPage);
      params.append("size", this.fenyexinxi.pagesize);
      params.append(
        "time",
        this.biaogeqingqiucanshu.selectshijian[0] +
          "~" +
          this.biaogeqingqiucanshu.selectshijian[1]
      );
      params.append("typeId", this.biaogeqingqiucanshu.leibie);
      params.append("villageId", this.biaogeqingqiucanshu.selectcun);
      params.append("zhenId", this.biaogeqingqiucanshu.selectzhen);

      this.$axios
        .post("/Leader/village/subsitybacktable", params)
        .then((response) => {
          this.tableData = response.data.data.data.records;
          // 设置数据total
          this.$emit("setfenyetotal", response.data.data.data.total);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    timezhuanhuan1: timezhuanhuan1,
  },
};
</script>

<style lang="less" scoped>
.el-table {
  height: 100%;
}
</style>